package com.xz;

import com.xz.list.LinkedList;
import com.xz.list.List;

/**
 * @author XZ
 * @create 2021-04-23 22:08
 */
public class Queue<E> implements QueueDao {

    private List<E> list = new LinkedList<>();

    @Override
    public int size() {
        return list.size();
    }

    @Override
    public boolean isEmpty() {
        return list.isEmpty();
    }

    @Override
    public void clear() {
        list.clear();
    }

    @Override
    public void enQueue(Object element) {
        list.add((E) element);
    }

    @Override
    public Object deQueue() {
        return list.remove(0);
    }

    @Override
    public Object front() {
        return list.get(0);
    }
}
